#define _CRT_SECURE_NO_WARNINGS 1
#include "List.h"

void test1()
{
	struct ListNode* phead = LTInit();
	LTPushBack(phead, 1);
	LTPushBack(phead, 2);
	LTPushBack(phead, 3);
	LTPushBack(phead, 4);
	LTPushBack(phead, 5);

	LTPopBack(phead);
	LTPopBack(phead);

	LTPrint(phead);
}

void test2()
{
	struct ListNode* phead = LTInit();
	LTPushFront(phead, 1);
	LTPushFront(phead, 2);
	LTPushFront(phead, 3);
	LTPushFront(phead, 4);
	LTPushFront(phead, 5);

	LTPopFront(phead);

	LTPrint(phead);
}

void test3()
{
	struct ListNode* phead = LTInit();
	LTPushBack(phead, 1);
	LTPushBack(phead, 2);
	LTPushBack(phead, 3);
	LTPushBack(phead, 4);
	LTPushBack(phead, 5);

	struct ListNode* pos = LTFind(phead, 3);
	if (pos)
		pos->data *= 10;

	LTPrint(phead);
	LTDestory(phead);
	phead = NULL;
}

int main()
{
	//test1();
	//test2();
	test3();

	return 0;
}